
package com.shop.cloud.mall.api.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shop.cloud.common.core.util.R;
import com.shop.cloud.mall.common.entity.ShopStore;
import com.shop.cloud.mall.api.service.ShopStoreService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;

/**
 * 店铺门店
 *
 * @author
 * @date 2023-05-18 10:05:56
 */
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/shopstore")
@Tag(description = "shopstore", name = "店铺门店API")
public class ShopStoreController {

    private final ShopStoreService shopStoreService;

    /**
     * 店铺门店分页列表
     * @param page 分页对象
     * @param shopStore 店铺门店
     * @return
     */
    @Operation(summary = "店铺门店分页列表")
    @GetMapping("/page")
    public R getPage(Page page, ShopStore shopStore) {
        return R.ok(shopStoreService.page2(page, shopStore));
    }

    /**
     * 店铺门店查询
     * @param id
     * @return R
     */
    @Operation(summary = "店铺门店查询")
    @GetMapping("/{id}")
    public R getById(@PathVariable("id") String id) {
        return R.ok(shopStoreService.getById(id));
    }

}
